package cn.fengliu;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
public class MyMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器，除了自定义静态资源，所有页面都需要经过此拦截器
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                //拦截所有路径


                .excludePathPatterns("/mark5/go2login","/mark5/login");
        //无需拦截的路径
    }
}
